<template>
  <div class="box">
    <h1>Child:{{count}}</h1>
    <!-- button进行双向数据绑定 -->
    <button @click="$emit('update:count' , count+1)">点击数据双向绑定</button>

    <!-- input进行数据双向绑定 -->
    <input type="text" :value="count"  @input="$emit('update:count' , $event.target.value)">
  </div>
</template>

<script>
export default {
  name: "Child",
  props: ["count"]
};
</script>

<style scoped>
.box {
  background: yellowgreen;
}
</style>
